package cn.z2huo.knowledge.designpattern.proxy.staticproxy;

/**
 * <p>
 *
 * @author z2huo
 */
class MyProxy implements MyService {

    private final MyService myService;

    public MyProxy() {
        this.myService = new MyServiceImpl();
    }

    @Override
    public void request() {
        System.out.println("request before");
        myService.request();
        System.out.println("request after");
    }

    @Override
    public void response() {
        System.out.println("response before");
        myService.response();
        System.out.println("response after");
    }

    public static void main(String[] args) {
        MyProxy proxyService = new MyProxy();
        proxyService.request();

        System.out.println();

        proxyService.response();
    }
}
